﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MethodSeqGenerator
{
    public class TypeHolder
    {
        String typeName;
        static int TypeHolderUniqueID = 0;
        String completeExprName = "";
        String varName = "";

        public String getCompleteExprName()
        {
            return this.completeExprName;            
        }

        public void setCompleteExprName(String completeExprName)
        {
            this.completeExprName = completeExprName;
        }

        public String getTypeName()
        {
            return this.typeName;
        }

        public void setTypeName(String typeName)
        {
            this.typeName = typeName;
        }
        
        public String getVarName()
        {
           return this.varName;
        }

        public void setVarName(String varName)
        {
            this.varName = varName;
        }

        public TypeHolder(String typeName)
        {
            this.typeName = typeName;
            this.varName = "UNKNOWN" + (TypeHolderUniqueID++);
            this.completeExprName = typeName;
        }

        public TypeHolder(String typeName, String varName)
        {
            this.typeName = typeName;
            this.varName = varName;
            this.completeExprName = typeName;
        }

        public override String ToString()
        {
            return typeName;
        }

        public override bool Equals(object obj)
        {
            if (obj is String)
            {
                return this.typeName.Equals(obj as String);
            }
            else
            {
                TypeHolder typObj1 = (TypeHolder)obj;
                return this.typeName.Equals(typObj1.typeName);
            }
        }
    }
}
